home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / dev / src / WBBump_src.lha / WBBump_src / Plugins / invert_supp.asm < prev    next >
Encoding:
Assembly Source File  |  1999-06-30  |  1.5 KB  |  73 lines

  1. ******************
  2. * invert_sub.asm *
  3. ******************
  4.  
  5.  
  6.  
  7. ***    WBBump - Bumpmapping on the Workbench!
  8.  
  9. ***    Copyright (C) 1999  Thomas Jensen - dm98411@edb.tietgen.dk
  10.  
  11. ***    This program is free software; you can redistribute it and/or modify
  12. ***    it under the terms of the GNU General Public License as published by
  13. ***    the Free Software Foundation; either version 2 of the License, or
  14. ***    (at your option) any later version.
  15.  
  16. ***    This program is distributed in the hope that it will be useful,
  17. ***    but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ***    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19. ***    GNU General Public License for more details.
  20.  
  21. ***    You should have received a copy of the GNU General Public License
  22. ***    along with this program; if not, write to the Free Software Foundation,
  23. ***    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  24.  
  25.  
  26.     xdef    invert_buffer_iii
  27.  
  28.  
  29. ***    inver_buffer(inbuf, outbuf, size)
  30.  
  31. *** 12 inbuf    :    ucharptr
  32. ***  8 outbuf    :    ucharptr
  33. ***  4 size    :    ulong
  34.  
  35.  
  36. invert_buffer_iii:
  37.     move.l    12(sp),a0
  38.     move.l    8(sp),a1
  39.     move.l    4(sp),d0
  40.  
  41.     move.l    d0,d1
  42.     and.l    #%1111,d0    *    rest in d0
  43.  
  44.     lsr.l    #4,d1        *    number of 16 byte words in d1
  45.  
  46. .l1
  47.     move.l    (a0)+,d2
  48.     move.l    (a0)+,d3
  49.     move.l    (a0)+,d4
  50.     move.l    (a0)+,d5
  51.     not.l    d2
  52.     not.l    d3
  53.     not.l    d4
  54.     not.l    d5
  55.     move.l    d2,(a1)+
  56.     move.l    d3,(a1)+
  57.     move.l    d4,(a1)+
  58.     move.l    d5,(a1)+
  59.  
  60.     sub.l    #1,d1
  61.     bne        .l1
  62.  
  63.     * the rest
  64.  
  65. .l2
  66.     move.b    (a0)+,d2
  67.     not.b    d2
  68.     move.b    d2,(a1)+
  69.     sub.b    #1,d0
  70.     bne        .l2
  71.  
  72.     rts
  73.